<?php

require_once 'classes/LightPressPlugin.php';

class AltTemplate extends LightPressPlugin {
    
    var $constructor_args = array(
        'template'=>'template to change, one of header/index/sidebar/footer',
        'template_file'=>'file to use instead of the LP default');
    var $default_context = LP_CONTEXT_POST;
    var $description = 'Change one of the default templates in specific contexts';
    
    var $active = true;
    var $hooks = array('start_render');
    
    var $template = 'sidebar';
    var $template_file = 'sidebar_alt.xml';
    
    function AltTemplate(&$frontend, $args, $dummy_run=false) {
        $this->LightPressPlugin($frontend, $args, $dummy_run);
    }
    
    function run($hook, &$payload) {
        if (isset($this->_frontend->templates[$this->template]))
            $this->_frontend->templates[$this->template] = $this->template_file;
    }
    
}

?>